var Ajax=window.Ajax=window.oy.Ajax={
	getReq:function(){
		var req=null;
		try{
			req=new XMLHttpRequest();
		}catch (e){
			try{
				req=new ActiveXObject("Msxml2.XMLHTTP");
			}catch (e){
				req=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		return req;
	},
	send:function(onwait,onok,ontimeout,method,url,querystr,asyn,timeout){
		var Ajax=this,req=Ajax.getReq(),timer,timeout=timeout||30000;
		timer = setTimeout(function(){ontimeout(req);},timeout);
		req.onreadystatechange=function(){
			if(req.readyState==4 && req.status==200){
				clearTimeout(timer);
				onok(req);
			}else{
				onwait(req);
			}
		}
		req.open(method,url,Boolean(asyn));
		if(method=='POST'){req.setRequestHeader('content-Type','application/x-www-form-urlencoded');}
		req.send(querystr);
	},
	get:function(onwait,onok,ontimeout,url,asyn,timeout){
		this.send(onwait,onok,ontimeout,'GET',url,null,asyn,timeout);
	},
	post:function(onwait,onok,ontimeout,url,querystr,asyn,timeout){
		this.send(onwait,onok,ontimeout,'POST',url,querystr,asyn,timeout);
	}
}
//Ajax.get(function(req){},function(req){},function(req){},url,asyn,timeout);
//Ajax.post(function(req){},function(req){},function(req){},url,querystr,asyn,timeout);